#include "../core/nodes/feature.h"
#include "field.h"
#include "visitordata.h"
#include "error.h"
#include "featuredeclvisitor.h"


bool Field::isAvailable(const std::string & className, SemanticVisitorData * data)
{
   for (unsigned  int i=0;i<m_clients.size();i++)
   {
	   if (m_clients[i]==className)
		   return true;
	   if (data->isAncestor(m_clients[i],className))
		   return true;
   }
   return false;
}

void Field::getCommonCompilableSignature(std::string & name, std::string & descriptor)
{
	name=m_classname;
	name+=m_realname;

	descriptor=m_type->getSimpleSignature();
}

void Field::getFullCompilableSignature(std::string & name, std::string & descriptor)
{
	name=m_classname;
	name+=m_realname;

	descriptor=m_type->getFullSignature();
}

void Field::getRefInfo(std::string & classname,std::string & name, std::string & descriptor)
{
	classname=m_classname;
	getCommonCompilableSignature(name,descriptor);
}